Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: FFmpeg/FFV1
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ce6988abac28
Choose a base ref
...
head repository: FFmpeg/FFV1
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 10fa55b6f70e
Choose a head ref
  • 5 commits
  • 1 file changed
  • 1 contributor

Commits on Dec 3, 2015

  1. typos

    dericed authored and michaelni committed Dec 3, 2015
    Copy the full SHA
    82bbb6d View commit details
  2. Copy the full SHA
    bad4526 View commit details
  3. capitalize Range coder when used

    dericed authored and michaelni committed Dec 3, 2015
    Copy the full SHA
    723fbd0 View commit details
  4. add missing table header labels

    dericed authored and michaelni committed Dec 3, 2015
    Copy the full SHA
    4eb2299 View commit details
  5. Copy the full SHA
    10fa55b View commit details
Showing with 30 additions and 30 deletions.
  1. +30 −30 ffv1.md
60 changes: 30 additions & 30 deletions ffv1.md
Original file line number Diff line number Diff line change
@@ -82,7 +82,7 @@ __a & b__ means bit-wise "and" of a and b.

__a | b__ means bit-wise "or" of a and b.

__a >> b__ means arithmetic righ shift of two’s complement integer representation of a by b binary digits.
__a >> b__ means arithmetic right shift of two’s complement integer representation of a by b binary digits.

__a << b__ means arithmetic left shift of two’s complement integer representation of a by b binary digits.
--------------- ----------------------------------------------------------------
@@ -104,25 +104,25 @@ __a -= b__ is equivalent to a = a - b.
## Comparison operators

--------------- ----------------------------------------------------------------
__a > b__ means a greater than b.
__a > b__ means a is greater than b.

__a >= b__ means a greater than or equal to b.
__a >= b__ means a is greater than or equal to b.

__a < b__ means a less than b.
__a < b__ means a is less than b.

__a <= b__ means a less than or equal b.
__a <= b__ means a is less than or equal b.

__a == b__ means a equal to b.
__a == b__ means a is equal to b.

__a != b__ means a not equalto b.
__a != b__ means a is not equalto b.

__a && b__ means boolean logical "and" of a and b.

__a || b__ means boolean logical "or" of a and b.

__!a__ means boolean logical "not".

__a ? b : c__ means b if a is true otherwise c.
__a ? b : c__ if a is true, then b, otherwise c.
--------------- ----------------------------------------------------------------

## Order of operation precedence
@@ -228,11 +228,11 @@ $coder\_input=\left[\left(sample\_difference+2^{bits-1}\right)\&\left(2^{bits}-1

### Range coding mode

Early experimental versions of FFV1 used the CABAC Arithmetic coder from [H.264](#references) but due to the uncertain patent/royality situation, as well as its slightly worse performance, CABAC was replaced by a range coder based on an algorithm defined by *G. Nigel N. Martin* in 1979 [RangeCoder](#references).
Early experimental versions of FFV1 used the CABAC Arithmetic coder from [H.264](#references) but due to the uncertain patent/royality situation, as well as its slightly worse performance, CABAC was replaced by a Range coder based on an algorithm defined by *G. Nigel N. Martin* in 1979 [RangeCoder](#references).

#### Range binary values

To encode binary digits efficiently a range coder is used. $C_{i}$ is the i-th Context. $B_{i}$ is the i-th byte of the bytestream. $b_{i}$ is the i-th range coded binary value, $S_{0,i}$ is the i-th initial state, which is 128. The length of the bytestream encoding n binary symbols is $j_{n}$ bytes.
To encode binary digits efficiently a Range coder is used. $C_{i}$ is the i-th Context. $B_{i}$ is the i-th byte of the bytestream. $b_{i}$ is the i-th Range coded binary value, $S_{0,i}$ is the i-th initial state, which is 128. The length of the bytestream encoding n binary symbols is $j_{n}$ bytes.

$r_{i}=\left\lfloor \frac{R_{i}S_{i,C_{i}}}{2^{8}}\right\rfloor$

@@ -283,7 +283,7 @@ void put_symbol(RangeCoder *c, uint8_t *state, int v, int is_signed) {

#### Initial values for the context model

At keyframes all range coder state variables are set to their initial state.
At keyframes all Range coder state variables are set to their initial state.

#### State transition table

@@ -448,7 +448,7 @@ Note, this is different from JPEG-LS, which doesn’t use prediction in run mode
# Bitstream
| | |
|Symbol| Defintion |
|------|--------------------------------------------------------|
| u(n) | unsigned big endian integer using n bits |
| sg | Golomb Rice coded signed scalar symbol coded with the method described in [Huffman Coding Mode](#huffman-coding-mode) |
@@ -464,7 +464,7 @@ Default values at the decoder initialization phase:
## Configuration Record
In the case of a bitstream with version >= 2, a configuration record is stored in the the underlying container, at the track header level.
In the case of a bitstream with version >= 2, a configuration record is stored in the underlying container, at the track header level.
It contains the parameters used for all frames.
The size of the configuration record, NumBytes, is supplied by the underlying container.
@@ -503,10 +503,10 @@ See [ISO14496_12](#references) for more information about boxes.
### In NUT File Format
The codec_specific_data element (in "stream_header" packet) contains the ConfigurationRecord bitstream.
The codec\_specific\_data element (in "stream_header" packet) contains the ConfigurationRecord bitstream.
See [NUT](#references) for more information about elements.
**NumBytes** is defined as the size, in bytes, of the codec_specific_data element as indicated in the "length" field of codec_specific_data
**NumBytes** is defined as the size, in bytes, of the codec\_specific\_data element as indicated in the "length" field of codec\_specific\_data
## Frame
@@ -543,7 +543,7 @@ See [NUT](#references) for more information about elements.
|    } | |
|} | |
**primary_color_count** is defined as 1 + ( chroma_planes ? 2 : 0 ) + ( alpha_plane ? 1 : 0 ).
**primary\_color\_count** is defined as 1 + ( chroma_planes ? 2 : 0 ) + ( alpha_plane ? 1 : 0 ).
**slice_size** indicates the size of the slice in bytes.
Note: this allows finding the start of slices before previous slices have been fully decoded. And allows this way parallel decoding as well as error resilience.
@@ -557,7 +557,7 @@ Note: this allows finding the start of slices before previous slices have been f
| 2 | slice contains a uncorrectable error |
| Other | reserved for future use |
**slice_crc_parity** 32 bits that are choosen so that the slice as a whole has a crc remainder of 0.
**slice\_crc\_parity** 32 bits that are choosen so that the slice as a whole has a crc remainder of 0.
This is equivalent to storing the crc remainder in the 32-bit parity.
The CRC generator polynom used is the standard IEEE CRC polynom (0x104C11DB7) with initial value 0.
@@ -593,9 +593,9 @@ Inferred to be 1 if not present.
**slice_height** indicates the height on the slice raster.
Inferred to be 1 if not present.
**quant_table_index_count** is defined as 1 + ( ( chroma_planes || version \< 4 ) ? 1 : 0 ) + ( alpha_plane ? 1 : 0 ).
**quant\_table\_index\_count** is defined as 1 + ( ( chroma_planes || version \< 4 ) ? 1 : 0 ) + ( alpha_plane ? 1 : 0 ).
**quant_table_index** indicates the index to select the quantization table set and the initial states for the slice.
**quant\_table\_index** indicates the index to select the quantization table set and the initial states for the slice.
Inferred to be 0 if not present.
**picture_structure** specifies the picture structure.
@@ -620,7 +620,7 @@ MUST be 0 if sample aspect ratio is unknown.
**reset_contexts** indicates if slice contexts must be reset.
Inferred to be 0 if not present.
**slice_coding_mode** indicates the slice coding mode.
**slice\_coding\_mode** indicates the slice coding mode.
Inferred to be 0 if not present.
|value | slice coding mode |
@@ -715,8 +715,8 @@ Meaning of micro_version for version 4 (note: at the time of writting of this sp
| 2 | Range Coder with custom state transition table |
| Other | reserved for future use |
**state_transition_delta** specifies the range coder custom state transition table.
If state_transition_delta is not present in the bitstream, all range coder custom state transition table elements are assumed to be 0.
**state_transition_delta** specifies the Range coder custom state transition table.
If state_transition_delta is not present in the bitstream, all Range coder custom state transition table elements are assumed to be 0.
**colorspace_type** specifies the color space.
@@ -733,7 +733,7 @@ If state_transition_delta is not present in the bitstream, all range coder custo
|0 | chroma planes are not present |
|1 | chroma planes are present |
**bits_per_raw_sample** indicates the number of bits for each luma and chroma sample. Inferred to be 8 if not present.
**bits\_per\_raw\_sample** indicates the number of bits for each luma and chroma sample. Inferred to be 8 if not present.
|value | bits for each luma and chroma sample |
|-------|-------------------------------------------------|
@@ -743,9 +743,9 @@ If state_transition_delta is not present in the bitstream, all range coder custo
\* Encoders MUST not store bits_per_raw_sample = 0
Decoders SHOULD accept and interpret bits_per_raw_sample = 0 as 8.
**h_chroma_subsample** indicates the subsample factor between luma and chroma width ($chroma\_width=2^{-log2\_h\_chroma\_subsample}luma\_width$)
**h\_chroma\_subsample** indicates the subsample factor between luma and chroma width ($chroma\_width=2^{-log2\_h\_chroma\_subsample}luma\_width$)
**v_chroma_subsample** indicates the subsample factor between luma and chroma height ($chroma\_height=2^{-log2\_v\_chroma\_subsample}luma\_height$)
**v\_chroma\_subsample** indicates the subsample factor between luma and chroma height ($chroma\_height=2^{-log2\_v\_chroma\_subsample}luma\_height$)
**alpha_plane**
: indicates if a transparency plane is present.
@@ -755,13 +755,13 @@ Decoders SHOULD accept and interpret bits_per_raw_sample = 0 as 8.
| 0 | transparency plane is not present|
| 1 | transparency plane is present |
**num_h_slices** indicates the number of horizontal elements of the slice raster.
**num\_h\_slices** indicates the number of horizontal elements of the slice raster.
Inferred to be 1 if not present.
**num_v_slices** indicates the number of vertical elements of the slice raster.
**num\_v\_slices** indicates the number of vertical elements of the slice raster.
Inferred to be 1 if not present.
**quant_table_count** indicates the number of quantization table sets.
**quant\_table\_count** indicates the number of quantization table sets.
Inferred to be 1 if not present.
**states_coded** indicates if the respective quantization table set has the initial states coded.
@@ -772,7 +772,7 @@ Inferred to be 0 if not present.
| 0 | initial states are not present and are assumed to be all 128|
| 1 | initial states are present |
**initial_state_delta** [ i ][ j ][ k ] indicates the initial range coder state, it is encoded using k as context index and
**initial\_state\_delta** [ i ][ j ][ k ] indicates the initial Range coder state, it is encoded using k as context index and
pred = j ? initial\_states[ i ][j - 1][ k ] : 128
initial\_state[ i ][ j ][ k ] = ( pred + initial\_state\_delta[ i ][ j ][ k ] ) & 255
@@ -816,7 +816,7 @@ QuantizationTable( i ) { // type
```


MAX_CONTEXT_INPUTS is 5.
MAX\_CONTEXT\_INPUTS is 5.

| | |
|---------------------------------------------------------------------------|------|